package sg.edu.nus.iss.vmcs.customer;

import java.awt.event.ActionEvent;

import sg.edu.nus.iss.vmcs.interfaces.Command;


/**
 * This is the concrete command
 * @author Rajasekaran Ramakrishnan 
 */

public class CoinInputCommand implements Command {
	
	private CoinReceiver receiver;
	public CoinInputCommand(CoinReceiver receiver) {
		this.receiver = receiver;
	}

	@Override
	public void execute(Object o) {
		try{
			System.out.println("Command:I am invoked by Adapter Either SWT or AWT(I dont care)");
		receiver.receiveCoin(Integer.parseInt((String)o));
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
}